package cn.wk.org.controller;

import cn.wk.basic.utils.AjaxResult;
import cn.wk.org.domain.Employee;
import cn.wk.org.service.IEmployeeService;
import cn.wk.user.domain.dto.LoginInfoDto;
import cn.wk.user.service.impl.LoginInfoServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/mylogin")
public class MyLoginController {
    @Autowired
    private IEmployeeService employeeService;


    /**
     * 传入logininfo id 然后找到emp
     * @param loginInfoDto
     * @return
     */
    @PostMapping
    public AjaxResult login(@RequestBody LoginInfoDto loginInfoDto){
        System.out.println(loginInfoDto.getId());
        return employeeService.findByLogininfoId(loginInfoDto.getId());
    }
}
